#ifndef __ABSTRACT_TASK_HH__
#define __ABSTRACT_TASK_HH__

#include "Common/Patterns/SubscriberPublisher.hh"

#include <boost/shared_ptr.hpp>

namespace Framework
{
	class AbstractTask
	{
		public:
			typedef boost::shared_ptr< AbstractTask > Ptr;

		public:
			Common::Patterns::Publisher startTaskPublisher;
			Common::Patterns::Publisher stopTaskPublisher;

		protected:
			virtual void run() = 0;

		public:
			AbstractTask() {};
			virtual ~AbstractTask() {};

			void start()
			{
				startTaskPublisher.notifySubscribers();

				run();

				stopTaskPublisher.notifySubscribers();
			}
	};
};

#endif //__ABSTRACT_SYSTEM_HH__
